
using System;

namespace MxitAPI {
	
	
	public class ModelFacade {
		
		static protected ModelFacade instance;
		
		public ModelFacade() {
		}
		
		static public ModelFacade Instance {
			get { 
				if ( instance == null )
					instance = new ModelFacade();
				return instance;
			}
		}
		
		public string GetLoginName() {
			return Connection.Instance.LoginName;
		}
		
		public string GetPassword() {
			return Connection.Instance.Password;
		}
		
		/**
		 * Should get the server, depending  on whether there is a connection established
		 */
		// Todo check for connection 
		// Todo check for primary or backup server
		public ServerInfo GetServerInfo() {
			return Connection.Instance.PrimaryServer;
		}
		
		/**
		 * Check if a connection to the Mxit server exists
		 */
		public bool IsConnectedToServer() {
			if ( Connection.Instance.ConnectionStatus == ConnectionStatus.Connected )
				return true;
			else // if ( Connection.Instance.ConnectionStatus == ConnectionStatus.Disconnected )
				return false;
		}
		
		public MessageTransceiver GetMessageTransceiver() {
			return Connection.Instance.MessageTranceiver;
		}
		
		
	}
}
